varying vec4 diffuseCol, ambientCol, ambientGlobal;
varying vec3 normal, lightDir, halfVector;
varying float dist;


void main(){
		 
	//just perform diffuse and ambient col in vertex shader, computer spec lighting in pixel/fragment shader
	
	//use dist to do pointlight
	
	vec4 ecPos;
	vec3 aux;
	ecPos = gl_ModelViewMatrix * gl_Vertex;
	aux = vec3(gl_LightSource[0].position-ecPos);
	lightDir = normalize(aux);
	dist = length(aux);//also length of vector is predefined
	
	
	//see explanations of computations in perVertexLighting shaders
	normal = normalize(gl_NormalMatrix * gl_Normal);
	lightDir = normalize(vec3(gl_LightSource[0].position));	//cause we use eye coords
	
	halfVector = normalize(gl_LightSource[0].halfVector.xyz);
	
	diffuseCol = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse;
	
	//seperating ambient color due to attenuation
	ambientCol = gl_FrontMaterial.ambient * gl_LightSource[0].ambient;
	ambientGlobal = gl_LightModel.ambient * gl_LightSource[0].ambient;
	
	gl_Position = ftransform();	//don't alter vertex position
	
}